package com.aaa.doctor.controller.api;

import com.aaa.doctor.service.CareOrderItemServivce;
import com.aaa.doctor.vo.CareOrderVo;
import com.aaa.entity.CareOrderItem;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

@RequestMapping("/doctor/api/CareOrderItem")
@RestController
public class ApiCareOrderItemController {

    @Autowired
    private CareOrderItemServivce careOrderItemServivce;

    /**
     * 查询检查处方
     * @param patientId
     * @return
     */
    @GetMapping("/getInfoByPatientId/{patinetId}")
    public Result<List<CareOrderItem>> getInfoByPatientId(@PathVariable String patientId){
        return careOrderItemServivce.getInfoByPatientId(patientId);
    }

    /**
     * 根据itemId删除当前选中行的数据
     * @param itemId
     * @return
     */
    @PostMapping("/deleteCareOrderItemById/{itemId}/{amount}")
    public Result<String> deleteCareOrderItemById(@PathVariable String itemId,@PathVariable BigDecimal amount){
        System.out.println("itemId11111111111111111111111111111 = " + itemId);
        System.out.println("amount111111111111111111111111111111111 = " + amount);
        return careOrderItemServivce.deleteCareOrderItemById(itemId,amount);
    }
}
